This page describes a program, splits, which splits a file into multiple pieces of a specified size.
splits is useful when transmitting large binary files over unreliable modem links with uucp. An accidental disconnection during a transmission causes the loss of everything received up to that point, requiring the user to start over from scratch. Breaking the file into multiple chunks with splits means that a disconnection only requires re-sending the chunk being transmitted when the hang-up occurred; if a chunk size substantially smaller than the average time between disconnects is chosen, lost communication time will be minimised.
splits may also be used to split large files being sent by electronic mail into pieces small enough to pass through intermediate mail forwarding sites. Some Internet mailers cannot process messages larger than 64K. splits allows you to circumvent this limitation. When sending binary files through electronic mail, you'll also have to encode the output of splits with a program such as uuencode or base64 since most mail systems accept only 7 bit ASCII characters.
Finally, splits allows subdividing large files into pieces which fit on various kinds of removable media such as 1.44 megabyte floppy discs.
On Unix the collection of chunks created with splits can be reassembled with cat. Simply use:
cat infile.* >infileto concatenate all the chunks together into an output file identical to the original splits input file. MS-DOS users can use the:
COPY /B infile1+...+infilen outfilecommand to concatenate chunks created with splits.
When sending files in multiple chunks, it's wise to accompany the transmission with a checksum created, for example, with sum or brik, so that the recipient can verify that all the pieces were correctly received and assembled in the proper order.
StdIn.001
, StdIn.002
, etc.
splits must read input and write output files in binary mode, without any translation of end of line or end of file characters. The splits source code contains code conditional on WIN32 which sets binary mode on that system. If you're porting splits to another platform which distinguishes text and binary I/O (Unix systems do not), you'll need to add equivalent code to set binary I/O mode.
splits.exe
(compiled using Microsoft Visual C++ 5.0),
and in source code form along with a
Makefile
to build the program under Unix.
This software is in the public domain. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, without any conditions or restrictions. This software is provided "as is" without express or implied warranty.